<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ResultsController;

Route::get('/', function () {
    return view('welcome');
});

// Serve visualization images from the non-public `results` directory in a
// read-only, validated manner. Filenames are validated in the controller to
// prevent traversal and limit returned file types.
Route::get('/results/{filename}', function ($filename) {
    $path = base_path('results/' . $filename);
    if (!file_exists($path))
        abort(404);
    return response()->file($path);
});
